/**
 * 用户相关类型定义
 */

// 登录表单数据
export interface LoginData {
  username: string
  password: string
  captcha?: string
}
export interface LoginSmsData { 
  phone?: string
  code?: string
}

export interface LoginScanData { 
  qrCode: string
}
// 用户信息
export interface UserInfo {
  id: number | string
  username: string
  nickname?: string
  avatar?: string
  email?: string
  phone?: string
  gender?: number
  department?: string
  position?: string
  status?: string|number
  createTime?: string
}

// 登录响应
export interface LoginResponse {
  token: string
  expiresIn: number
}

// 用户角色
export interface UserRole {
  id: number
  name: string
  code: string
  description?: string
}

// 用户权限
export interface UserPermission {
  id: number
  name: string
  code: string
  type: 'menu' | 'button' | 'api'
  parentId?: number
  path?: string
  icon?: string
  sort?: number
}

export interface UserState {
  token: string
  userInfo: UserInfo | null
  roles: string[]
  permissions: string[]
}

export interface UserItem {
  id: string
  username: string
  status?: string
  phone?: string
  email?: string
  isActive:boolean
  role?: string
}
// 创建用户参数类型
export interface CreateUserParams {
  username: string
  status: string
  email?: string
  phone?: string
  role?: string
}

// 注册参数类型
export interface RegisterParams {
  username: string
  password: string
  email?: string
  phone?: string
  captcha?: string
}

// 验证码参数类型
export interface CaptchaParams {
  phone: string
}